import { getGameObjectById } from "../engine";
import { Behaviour } from "../engine/Behaviour";
import { TextRenderer } from "../engine/TextRenderer";
import { Transform } from "../engine/Transform";
import { dateStorageInUI } from "./dateStorageInUI";
import { Display } from "./Display";
import { Drag } from "./Drag";
import { Tip } from "./Tip";
import { Audio } from "../engine/Audio";
import { BitmapRenderer } from "../engine/BitmapRenderer";
import { BillSystem } from "./BillSystem";

export class ControlCharactor extends Behaviour {


    charactor_1="Character_1"
    charactor_2="Character_2"
    charactor_3="Character_3"
    charactor_4="Character_4"
    charactor_5="Character_5"
    currentcharactorid="Character_1"
    currentday=1//当天天数
    charactornumber=2//当前天数需要完成的订单数
    IsHasLengmian=false//cook场景是否做了冷面

    lastday=0
    currentSpeed=5
    iscurrentcharactoriddowm=false;
    iscurrentcharactoridup=true;
    //让满意度暂停只执行一次
    onlyOnce = true

    sum=100;
    income=0;
    cost=0;
    rental=20;
    fee=0;
    fee_1=0;
    profit=0;
    profit1:string
    order:string;
    currentOrder:string;

    IsMoneyMove=false;
    IsMoneyTextMove=false;
    MoneyText:string;
    TipText:string;
    IsTipMove=false;
    IsTipTextMove=false;

    cannotBuy=false;

    putEgg = 0
    putSausage = 0
    putChiken = 0
    putBacon = 0
    putLatiao = 0
    putSugar = 0
    putXiangcai = 0
    putOnion = 0
    putSuanrong = 0
    putConghua = 0
    putvinegar=0
    putspicy=0
    putxiangcai=0
    putsauce=0
    putBox=false

    onStart(){


     
        this.lastday=this.currentday
        if(getGameObjectById("dateStorage")){
         this.currentday=getGameObjectById("dateStorage").getBehaviour(dateStorageInUI).currentday;
         this.IsHasLengmian=getGameObjectById("dateStorage").getBehaviour(dateStorageInUI).IsHasLengmian;
         this.putSausage=getGameObjectById('dateStorage').getBehaviour(dateStorageInUI).putsausage;
         this.putChiken=getGameObjectById('dateStorage').getBehaviour(dateStorageInUI).putchiken;
         this.putBacon=getGameObjectById('dateStorage').getBehaviour(dateStorageInUI).putbacon;
         this.putLatiao=getGameObjectById('dateStorage').getBehaviour(dateStorageInUI).putlatiao;
         this.putSugar=getGameObjectById('dateStorage').getBehaviour(dateStorageInUI).putsugar;
         this.putXiangcai=getGameObjectById('dateStorage').getBehaviour(dateStorageInUI).putxiangcai;
         this.putOnion=getGameObjectById('dateStorage').getBehaviour(dateStorageInUI).putonion;
         this.putSuanrong=getGameObjectById('dateStorage').getBehaviour(dateStorageInUI).putsuanrong;
         this.putConghua=getGameObjectById('dateStorage').getBehaviour(dateStorageInUI).putconghua;
         this.putspicy=getGameObjectById('dateStorage').getBehaviour(dateStorageInUI).putspicy;
         this.putEgg=getGameObjectById('dateStorage').getBehaviour(dateStorageInUI).putEgg;
         this.putsauce=getGameObjectById('dateStorage').getBehaviour(dateStorageInUI).putsauce;
         this.putBox=getGameObjectById('dateStorage').getBehaviour(dateStorageInUI).putBJUT;
         this.putvinegar=getGameObjectById('dateStorage').getBehaviour(dateStorageInUI).putvinegar;
        
         getGameObjectById('dateStorage').getBehaviour(dateStorageInUI).putsausage=0;
         getGameObjectById('dateStorage').getBehaviour(dateStorageInUI).putEgg=0;
         getGameObjectById('dateStorage').getBehaviour(dateStorageInUI).putchiken=0;
         getGameObjectById('dateStorage').getBehaviour(dateStorageInUI).putbacon=0;
         getGameObjectById('dateStorage').getBehaviour(dateStorageInUI).putlatiao=0;
         getGameObjectById('dateStorage').getBehaviour(dateStorageInUI).putsugar=0;
         getGameObjectById('dateStorage').getBehaviour(dateStorageInUI).putxiangcai=0;
         getGameObjectById('dateStorage').getBehaviour(dateStorageInUI).putonion=0;
         getGameObjectById('dateStorage').getBehaviour(dateStorageInUI).putsuanrong=0;
         getGameObjectById('dateStorage').getBehaviour(dateStorageInUI).putconghua=0;
         getGameObjectById('dateStorage').getBehaviour(dateStorageInUI).putspicy=0;
         getGameObjectById('dateStorage').getBehaviour(dateStorageInUI).putsauce=0;
         getGameObjectById('dateStorage').getBehaviour(dateStorageInUI).putBJUT=false;
         getGameObjectById('dateStorage').getBehaviour(dateStorageInUI).putvinegar=0;
        

         this.currentOrder=getGameObjectById('dateStorage').getBehaviour(dateStorageInUI).currentOrder;
        
         console.log("测试get值",getGameObjectById('dateStorage').getBehaviour(dateStorageInUI).putEgg);     
        

         console.log("当前天数",getGameObjectById("dateStorage").getBehaviour(dateStorageInUI).currentday)
         console.log("当前是否有冷面",getGameObjectById("dateStorage").getBehaviour(dateStorageInUI).IsHasLengmian)        
        }

        if(this.lastday!=this.currentday){
            console.log("天数变了")
            this.ShowOrHideBill(false);//是否展示账单
            this.iscurrentcharactoridup=true;
            switch(this.currentday){
            case 1:this.charactornumber=2
                break;
            case 2:this.charactornumber =3
               break;
            case 3:this.charactornumber =4
               break;
            case 4:this.charactornumber =5
               break;
            default:this.charactornumber =5
            break;
        }
        }
        if(getGameObjectById("UI_button_suanle")){
        getGameObjectById("UI_button_suanle").onClick = () => {
           // console.log(this.gameObject.id);
            if(getGameObjectById("UI_button_suanle").id=='UI_button_suanle'){
                getGameObjectById('UI_button_suanle').getBehaviour(Display).IsActive=false;
                getGameObjectById('UI_dialog_frame').getBehaviour(Display).IsActive=false;
                getGameObjectById('UI_dialog_requirement').getBehaviour(Display).IsActive=false;
                getGameObjectById('UI_dialog_cannotbuy_tip').getBehaviour(Display).IsActive=false;
                this.cannotBuy=true;
                this.iscurrentcharactoriddowm=true;
            }
       };}

       

    }

    onUpdate(){
        this.order=getGameObjectById('UI_dialog_requirement').getBehaviour(TextRenderer).text;
        console.log("获取到的订单",this.order)
        this.income=Number(getGameObjectById('Text_Income').getBehaviour(TextRenderer).text);
        this.sum=Number(getGameObjectById('UI_money_text').getBehaviour(TextRenderer).text);
        this.cost=Number(getGameObjectById('Text_cost').getBehaviour(TextRenderer).text);
        this.fee=Number(getGameObjectById('Text_Fee').getBehaviour(TextRenderer).text);
        this.profit=Number(getGameObjectById('Text_profit').getBehaviour(TextRenderer).text);
        this.profit1 = this.profit.toFixed(2)
        getGameObjectById('Text_profit').getBehaviour(TextRenderer).text = this.profit1 
        //console.log("profit!!")
        //console.log(this.profit)

        //换成bjut盒子
        if(getGameObjectById('UI_button_money_BJUTBox').getBehaviour(BillSystem).IsSold_BJUTBox==true){
            getGameObjectById('skin_finish').getBehaviour(BitmapRenderer).source = "./assets/images/bjut烤冷面_finish_1.png"
        }


        if(getGameObjectById("skin_finish")){    
        if(getGameObjectById("skin_finish").getBehaviour(Drag).IsTouch){//Drag脚本挂在冷面上，对应touch的物体写桌面上的对勾
            //让满意度冻结
            if(this.onlyOnce){
                //上完菜了，让满意度停止减少
             getGameObjectById('UI_satisfaction_text').getBehaviour(Tip).giveToGuest = true
             console.log("满意度停止减少，给客人状态：" +  getGameObjectById('UI_satisfaction_text').getBehaviour(Tip).giveToGuest)
            this.PayBill(this.order); 
            this.DialogCommentClose();
            //this.DialogClose();    
            getGameObjectById('moneySound').getBehaviour(Audio).Play();//播放给钱声音    


             this.onlyOnce = false
            }
            
            this.IsHasLengmian=false//冷面消失
            this.iscurrentcharactoriddowm=true
            this.IsMoneyTextMove=true;
            this.IsMoneyMove=true;
            this.IsTipMove=true;
            this.IsTipTextMove=true;
            console.log("没有冷面",this.charactornumber)
           }  
        
           if(this.IsHasLengmian){//改变烤冷面是否显示
                getGameObjectById("skin_finish").active=true;
                this.DialogOrderClose(); 
                this.Dialog_Comment(this.currentOrder);  
            }else{
                getGameObjectById("skin_finish").active=false;
                
            }
          }

        if(this.IsMoneyMove){
            console.log("IsMoneyMove",this.IsMoneyMove)
         getGameObjectById('UI_money').active=true;
         if(getGameObjectById('UI_money').getBehaviour(Transform).y>=300){
             getGameObjectById('UI_money').getBehaviour(Transform).y -= 0.5;
         }else{
             getGameObjectById('UI_money').active=false;
             getGameObjectById('UI_money').getBehaviour(Transform).y=350;
             this.IsMoneyMove=false;
         }
    
        }


        if(this.IsMoneyTextMove){
         getGameObjectById('UI_money_Text').active=true;
         getGameObjectById('UI_money_Text').getBehaviour(TextRenderer).text=this.MoneyText;
         if(getGameObjectById('UI_money_Text').getBehaviour(Transform).y>=340){
             getGameObjectById('UI_money_Text').getBehaviour(Transform).y -= 0.5;
         }else{
             getGameObjectById('UI_money_Text').active=false;
             getGameObjectById('UI_money_Text').getBehaviour(Transform).y=390;
             this.IsMoneyTextMove=false;
         }
        }

        if(this.IsTipMove){
            getGameObjectById('UI_tip').active=true;
            if(getGameObjectById('UI_tip').getBehaviour(Transform).y>=300){
                getGameObjectById('UI_tip').getBehaviour(Transform).y-=0.5;
            }else{
                getGameObjectById('UI_tip').active=false;
                getGameObjectById('UI_tip').getBehaviour(Transform).y=360;
                this.IsTipMove=false;
            }
        }

        if(this.IsTipTextMove){
            getGameObjectById('UI_Tip_Text').active=true;
            getGameObjectById('UI_Tip_Text').getBehaviour(TextRenderer).text=this.TipText;
            if(getGameObjectById('UI_Tip_Text').getBehaviour(Transform).y>=340){
                getGameObjectById('UI_Tip_Text').getBehaviour(Transform).y -= 0.5;
            }else{
                getGameObjectById('UI_Tip_Text').active=false;
                getGameObjectById('UI_Tip_Text').getBehaviour(Transform).y=390;
                this.IsTipTextMove=false;
            }
        }

            //人物向上
        if(this.iscurrentcharactoridup){
        if(getGameObjectById(this.currentcharactorid).getBehaviour(Transform).y>=130){
                getGameObjectById(this.currentcharactorid).getBehaviour(Transform).y -= this.currentSpeed;
           }else{
            console.log("人物到最上面")
            this.cannotBuy=false;
            this.iscurrentcharactoridup=false
           }
        }

        //人物向下
        if(this.iscurrentcharactoriddowm){
         if(getGameObjectById(this.currentcharactorid).getBehaviour(Transform).y<=450){
            getGameObjectById(this.currentcharactorid).getBehaviour(Transform).y += this.currentSpeed;
         }else{
            this.onlyOnce = true  
           // this.PayBill(this.order);   
            console.log("人物到底")
            if(this.cannotBuy==false){
               this.charactornumber--//拒绝接单加判断，改iscurrentcharactoriddowm值
              //this.cannotBuy=false;
            }
            //else{
                //this.iscurrentcharactoriddowm=false
                //this.charactornumber--//拒绝接单加判断，改iscurrentcharactoriddowm值
            //}
            this.changeCharactor()
            this.iscurrentcharactoriddowm=false
            if( getGameObjectById('UI_time_text').getBehaviour(TextRenderer).text =="24：00"||this.charactornumber<=0){
                this.ShowOrHideBill(true);//是否展示账单
            }else{
                this.iscurrentcharactoridup=true 
            }
         }
        }
        }

        DialogOrderClose(){
           // let order=getGameObjectById('UI_dialog_requirement').getBehaviour(TextRenderer).text;
               getGameObjectById('UI_dialog_frame').getBehaviour(Display).IsActive=true;
               getGameObjectById('UI_dialog_requirement').getBehaviour(Display).IsActive=false;
               getGameObjectById('UI_dialog_button_getIt').getBehaviour(Display).IsActive=false;
               getGameObjectById('UI_dialog_button_what').getBehaviour(Display).IsActive=false;
               getGameObjectById('UI_dialog_requirement_detail').getBehaviour(Display).IsActive=false;
               getGameObjectById('UI_dialog_comment').getBehaviour(Display).IsActive=true;
            //   return order;
        }

        DialogCommentClose(){
            getGameObjectById('UI_dialog_frame').getBehaviour(Display).IsActive=false;
            getGameObjectById('UI_dialog_comment').getBehaviour(Display).IsActive=false;
        }

        Dialog_Comment(order:string){
            //let order=getGameObjectById('UI_dialog_requirement').getBehaviour(TextRenderer).text;
            console.log("Dialog_Comment的当前订单",order);
            switch(order){
                case "来一份经典原味的烤冷面！":{
                    console.log("测试",this.putEgg,this.putOnion,this.putXiangcai,this.putSugar,this.putvinegar,this.putsauce)
                    if(this.putEgg!=0&&
                        this.putOnion==1&&
                        this.putXiangcai==1&&
                        this.putSugar==1&&
                        this.putvinegar==1&&
                        this.putsauce==1){
                           
                        getGameObjectById('UI_dialog_comment').getBehaviour(TextRenderer).text="你家烤冷面最棒了！";
                    }else {
                        getGameObjectById('UI_dialog_comment').getBehaviour(TextRenderer).text="谁家烤冷面这样啊！";
                    }
                   break;
                }

                case "老板，我要一个经典加肠烤冷面。":{
                    console.log("测试",this.putEgg,this.putOnion,this.putXiangcai,this.putSugar,this.putvinegar,this.putsauce)
                    if(this.putEgg!=0&&
                        this.putOnion==1&&
                        this.putXiangcai==1&&
                        this.putSugar==1&&
                        this.putvinegar==1&&
                        this.putsauce==1&&this.putSausage==1){
                        getGameObjectById('UI_dialog_comment').getBehaviour(TextRenderer).text="真不错！烤肠真是我的最爱！";
                    }else if(this.putSausage==0){
                        getGameObjectById('UI_dialog_comment').getBehaviour(TextRenderer).text="我的烤肠呢！气死了！";
                    }else{
                        getGameObjectById('UI_dialog_comment').getBehaviour(TextRenderer).text="老板是不是给我少放了什么！";
                    }
                    break;
                }  

                case "来份火辣辣烤冷面！":{
                    console.log("是否放辣条",this.putLatiao);
                    if(this.putEgg!=0&&
                        this.putOnion==1&&
                        this.putXiangcai==1&&
                        this.putSugar==1&&
                        this.putvinegar==1&&
                        this.putsauce==1&&
                        this.putLatiao==1){
                        getGameObjectById('UI_dialog_comment').getBehaviour(TextRenderer).text="不错~是小时候的味道。";
                    }else if(this.putLatiao==0){
                        getGameObjectById('UI_dialog_comment').getBehaviour(TextRenderer).text="我说了我要辣条啊！";
                    }else{
                        getGameObjectById('UI_dialog_comment').getBehaviour(TextRenderer).text="老板是不是给我少放了什么！";
                    }
                    break;
                }  

                case "我要一个加鸡柳烤冷面。":{
                    if(this.putEgg!=0&&
                        this.putOnion==1&&
                        this.putXiangcai==1&&
                        this.putSugar==1&&
                        this.putvinegar==1&&
                        this.putsauce==1&&
                        this.putChiken==1){
                        getGameObjectById('UI_dialog_comment').getBehaviour(TextRenderer).text="给努力学习的自己加肉喽！";
                    }else if( this.putChiken==0){
                        getGameObjectById('UI_dialog_comment').getBehaviour(TextRenderer).text="我的鸡柳儿长腿跑了吗？！";
                    }else{
                        getGameObjectById('UI_dialog_comment').getBehaviour(TextRenderer).text="老板是不是给我少放了什么！";
                    }
                    break;
                } 

                case "我要一个烤冷面加培根。":{
                    if(this.putEgg!=0&&
                        this.putOnion==1&&
                        this.putXiangcai==1&&
                        this.putSugar==1&&
                        this.putvinegar==1&&
                        this.putsauce==1&&
                        this.putBacon==1){
                        getGameObjectById('UI_dialog_comment').getBehaviour(TextRenderer).text="今天的培根烤冷面可真好吃。";
                    }else if(this.putBacon==0){
                        getGameObjectById('UI_dialog_comment').getBehaviour(TextRenderer).text="我不是说了要培根吗！";
                    }else{
                        getGameObjectById('UI_dialog_comment').getBehaviour(TextRenderer).text="老板是不是给我少放了什么！";
                    }
                    break;
                } 

                case "原味的加蒜蓉酱！":{
                    if(this.putEgg!=0&&
                        this.putOnion==1&&
                        this.putXiangcai==1&&
                        this.putSugar==1&&
                        this.putvinegar==1&&
                        this.putSuanrong==1){
                        getGameObjectById('UI_dialog_comment').getBehaviour(TextRenderer).text="蒜香烤冷面真特别~";
                    }else if(this.putSuanrong==0){
                        getGameObjectById('UI_dialog_comment').getBehaviour(TextRenderer).text="我说蒜蓉酱啊！怎么还是原味酱！";
                    }else{
                        getGameObjectById('UI_dialog_comment').getBehaviour(TextRenderer).text="老板是不是给我少放了什么！";
                    }
                    break;
                }

                case "没人不喜欢葱花吧！你说是不是！":{
                    if(this.putEgg!=0&&
                        this.putOnion==1&&
                        this.putXiangcai==1&&
                        this.putSugar==1&&
                        this.putvinegar==1&&
                        this.putsauce==1&&
                        this.putConghua==1){
                        getGameObjectById('UI_dialog_comment').getBehaviour(TextRenderer).text="吃葱花真的能变聪明吧？";
                    }else if(this.putConghua==0){
                        getGameObjectById('UI_dialog_comment').getBehaviour(TextRenderer).text="一把葱花才多少钱啊这都舍不得放！";
                    }else{
                        getGameObjectById('UI_dialog_comment').getBehaviour(TextRenderer).text="老板是不是给我少放了什么！";
                    }
                    break;
                }

                case "原味的！我爱BJUT！":{
                    if(this.putEgg!=0&&
                        this.putOnion==1&&
                        this.putXiangcai==1&&
                        this.putSugar==1&&
                        this.putvinegar==1&&
                        this.putsauce==1&&
                        this.putBox==true){
                        getGameObjectById('UI_dialog_comment').getBehaviour(TextRenderer).text="我爱上学校，天天不迟到！";
                    }else if(this.putBox==false){
                        getGameObjectById('UI_dialog_comment').getBehaviour(TextRenderer).text="你毁了我对BJUT的多少温柔！";
                    }else{
                        getGameObjectById('UI_dialog_comment').getBehaviour(TextRenderer).text="老板是不是给我少放了什么！";
                    }
                    break;
                }

                case "老板，最近想尝尝辣酱了~":{
                    if(this.putEgg!=0&&
                        this.putOnion==1&&
                        this.putXiangcai==1&&
                        this.putSugar==1&&
                        this.putvinegar==1&&
                        this.putsauce==1&&this.putspicy==1){
                        getGameObjectById('UI_dialog_comment').getBehaviour(TextRenderer).text="我可是无辣不欢的！？";
                    }else if(this.putspicy==0){
                        getGameObjectById('UI_dialog_comment').getBehaviour(TextRenderer).text="怎么一点也不辣？";
                    }else{
                        getGameObjectById('UI_dialog_comment').getBehaviour(TextRenderer).text="老板是不是给我少放了什么！";
                    }
                    break;
                }

                case "老板，来一个豪华套餐！":{
                    if( this.putEgg!=0&&
                        this.putOnion==1&&
                        this.putXiangcai==1&&
                        this.putSugar==1&&
                        this.putvinegar==1&&
                        this.putsauce==1&&
                        this.putBacon==1&&
                        this.putChiken==1&&
                        this.putLatiao==1&&
                        this.putSausage==1){
                        getGameObjectById('UI_dialog_comment').getBehaviour(TextRenderer).text="谢谢老板！祝生意兴隆！";
                    }else{
                        getGameObjectById('UI_dialog_comment').getBehaviour(TextRenderer).text="我付你这么多钱，竟然缺斤少两！";
                    }
                    break;
                }
            }
        }


        ShowOrHideBill(isshow:boolean){//是否展示账单
            getGameObjectById('UI_Bill').getBehaviour(Display).IsActive=isshow;
            getGameObjectById('Text_day_number').getBehaviour(Display).IsActive=isshow;
            getGameObjectById('Text_Income').getBehaviour(Display).IsActive=isshow;
            getGameObjectById('Text_Fee').getBehaviour(Display).IsActive=isshow;
            getGameObjectById('Text_Rental').getBehaviour(Display).IsActive=isshow;
            getGameObjectById('Text_cost').getBehaviour(Display).IsActive=isshow;
            getGameObjectById('Text_profit').getBehaviour(Display).IsActive=isshow;
            getGameObjectById('UI_Button_Nextday').getBehaviour(Display).IsActive=isshow;       
        }
        changeCharactor(){
            console.log("人物变化")
            switch(this.GetRandomNum(1,5)){
            case 1:
                this.currentcharactorid=this.charactor_1
                break;
            case 2:
                this.currentcharactorid=this.charactor_2
                break;
            case 3:
                this.currentcharactorid=this.charactor_3
                break;
            case 4:
                this.currentcharactorid=this.charactor_4
                break;
            case 5:
                this.currentcharactorid=this.charactor_5
                break;

            }
    
        }
        GetRandomNum(Min:number,Max:number){
        let Range=Max-Min;
        let Rand=Math.random();
        return (Min+Math.round(Range*Rand));
        }
    
        PayBill(order:string){
            getGameObjectById('UI_satisfaction_text').getBehaviour(Tip).getTip=true;
            //this.fee_1=getGameObjectById('UI_satisfaction_text').getBehaviour(Tip).tip;
            this.fee_1 = getGameObjectById('UI_satisfaction_text').getBehaviour(Tip).randomTip()
            console.log("第一天小费"+this.fee_1);
        switch(order){
            case "来一份经典原味的烤冷面！":{
                this.sum+=7;
                this.income+=7;
                this.fee+=this.fee_1;
                console.log("第一天小费"+this.fee);
                this.profit=(this.income+this.fee)-(this.cost+this.rental);
                getGameObjectById('Text_Income').getBehaviour(TextRenderer).text=String(this.income);
                getGameObjectById('Text_Fee').getBehaviour(TextRenderer).text=this.fee.toFixed(2);
                getGameObjectById('UI_money_text').getBehaviour(TextRenderer).text=String(this.sum);
                getGameObjectById('Text_cost').getBehaviour(TextRenderer).text=String(this.cost);
                getGameObjectById('Text_profit').getBehaviour(TextRenderer).text=String(this.profit);
                this.MoneyText="+7";
                this.TipText="+"+String(this.fee_1.toFixed(2));
                break;
            }

            case "老板，我要一个经典加肠烤冷面。":{
                this.sum+=9;
                this.income+=9;
                this.fee+=this.fee_1;
                console.log("第一天小费"+this.fee);
                this.profit=(this.income+this.fee)-(this.cost+this.rental);
                getGameObjectById('Text_Income').getBehaviour(TextRenderer).text=String(this.income);
                getGameObjectById('Text_Fee').getBehaviour(TextRenderer).text=this.fee.toFixed(2);
                getGameObjectById('UI_money_text').getBehaviour(TextRenderer).text=String(this.sum);
                getGameObjectById('Text_cost').getBehaviour(TextRenderer).text=String(this.cost);
                getGameObjectById('Text_profit').getBehaviour(TextRenderer).text=String(this.profit);
                this.MoneyText="+9";
                this.TipText="+"+String(this.fee_1.toFixed(2));
                break;
            }

            case "来份火辣辣烤冷面！":{
                this.sum+=8;
                this.income+=8;
                this.fee+=this.fee_1;
                console.log("第一天小费"+this.fee);
                this.profit=(this.income+this.fee)-(this.cost+this.rental);
                getGameObjectById('Text_Income').getBehaviour(TextRenderer).text=String(this.income);
                getGameObjectById('Text_Fee').getBehaviour(TextRenderer).text=this.fee.toFixed(2);
                getGameObjectById('UI_money_text').getBehaviour(TextRenderer).text=String(this.sum);
                getGameObjectById('Text_cost').getBehaviour(TextRenderer).text=String(this.cost);
                getGameObjectById('Text_profit').getBehaviour(TextRenderer).text=String(this.profit);
                this.MoneyText="+8";
                this.TipText="+"+String(this.fee_1.toFixed(2));
                break;
            }

            case "我要一个加鸡柳烤冷面。":{
                this.sum+=10;
                this.income+=10;
                this.fee+=this.fee_1;
                this. profit=(this.income+this.fee)-(this.cost+this.rental);
                getGameObjectById('Text_Income').getBehaviour(TextRenderer).text=String(this.income);
                getGameObjectById('Text_Fee').getBehaviour(TextRenderer).text=this.fee.toFixed(2);
                getGameObjectById('UI_money_text').getBehaviour(TextRenderer).text=String(this.sum);
                getGameObjectById('Text_cost').getBehaviour(TextRenderer).text=String(this.cost);
                getGameObjectById('Text_profit').getBehaviour(TextRenderer).text=String(this.profit);
                this.MoneyText="+10";
                this.TipText="+"+String(this.fee_1.toFixed(2));
                break;
            }

            case "我要一个烤冷面加培根。":{
                this.sum+=8;
                this.income+=8;
                this.fee+=this.fee_1;
                this. profit=(this.income+this.fee)-(this.cost+this.rental);
                getGameObjectById('Text_Income').getBehaviour(TextRenderer).text=String(this.income);
                getGameObjectById('Text_Fee').getBehaviour(TextRenderer).text=this.fee.toFixed(2);
                getGameObjectById('UI_money_text').getBehaviour(TextRenderer).text=String(this.sum);
                getGameObjectById('Text_cost').getBehaviour(TextRenderer).text=String(this.cost);
                getGameObjectById('Text_profit').getBehaviour(TextRenderer).text=String(this.profit);
                this.MoneyText="+8";
                this.TipText="+"+String(this.fee_1.toFixed(2));
                break;
            }

            case "原味的加蒜蓉酱！":{
                this.sum+=8;
                this.income+=8;
                this.fee+=this.fee_1;
                this. profit=(this.income+this.fee)-(this.cost+this.rental);
                getGameObjectById('Text_Income').getBehaviour(TextRenderer).text=String(this.income);
                getGameObjectById('Text_Fee').getBehaviour(TextRenderer).text=this.fee.toFixed(2);
                getGameObjectById('UI_money_text').getBehaviour(TextRenderer).text=String(this.sum);
                getGameObjectById('Text_cost').getBehaviour(TextRenderer).text=String(this.cost);
                getGameObjectById('Text_profit').getBehaviour(TextRenderer).text=String(this.profit);
                this.MoneyText="+8";
                this.TipText="+"+String(this.fee_1.toFixed(2));
                break;
            }

            case "没人不喜欢葱花吧！你说是不是！":{
                this.sum+=7;
                this.income+=7;
                this.fee+=this.fee_1;
                this. profit=(this.income+this.fee)-(this.cost+this.rental);
                getGameObjectById('Text_Income').getBehaviour(TextRenderer).text=String(this.income);
                getGameObjectById('Text_Fee').getBehaviour(TextRenderer).text=this.fee.toFixed(2);
                getGameObjectById('UI_money_text').getBehaviour(TextRenderer).text=String(this.sum);
                getGameObjectById('Text_cost').getBehaviour(TextRenderer).text=String(this.cost);
                getGameObjectById('Text_profit').getBehaviour(TextRenderer).text=String(this.profit);
                this.MoneyText="+7";
                this.TipText="+"+String(this.fee_1.toFixed(2));
                break;
            }

            case "原味的！我爱BJUT！":{
                this.sum+=9;
                this.income+=9;
                this.fee+=this.fee_1;
                this. profit=(this.income+this.fee)-(this.cost+this.rental);
                getGameObjectById('Text_Income').getBehaviour(TextRenderer).text=String(this.income);
                getGameObjectById('Text_Fee').getBehaviour(TextRenderer).text=this.fee.toFixed(2);
                getGameObjectById('UI_money_text').getBehaviour(TextRenderer).text=String(this.sum);
                getGameObjectById('Text_cost').getBehaviour(TextRenderer).text=String(this.cost);
                getGameObjectById('Text_profit').getBehaviour(TextRenderer).text=String(this.profit);
                this.MoneyText="+9";
                this.TipText="+"+String(this.fee_1.toFixed(2));
                break;
            }

            case "老板，最近想尝尝辣酱了~":{
                this.sum+=8;
                this.income+=8;
                this.fee+=this.fee_1;
                this. profit=(this.income+this.fee)-(this.cost+this.rental);
                getGameObjectById('Text_Income').getBehaviour(TextRenderer).text=String(this.income);
                getGameObjectById('Text_Fee').getBehaviour(TextRenderer).text=this.fee.toFixed(2);
                getGameObjectById('UI_money_text').getBehaviour(TextRenderer).text=String(this.sum);
                getGameObjectById('Text_cost').getBehaviour(TextRenderer).text=String(this.cost);
                getGameObjectById('Text_profit').getBehaviour(TextRenderer).text=String(this.profit);
                this.MoneyText="+8";
                this.TipText="+"+String(this.fee_1.toFixed(2));
                break;
            }

            case "老板，来一个豪华套餐！":{
                this.sum+=15;
                this.income+=15;
                this.fee+=this.fee_1;
                this. profit=(this.income+this.fee)-(this.cost+this.rental);
                getGameObjectById('Text_Income').getBehaviour(TextRenderer).text=String(this.income);
                getGameObjectById('Text_Fee').getBehaviour(TextRenderer).text=this.fee.toFixed(2);
                getGameObjectById('UI_money_text').getBehaviour(TextRenderer).text=String(this.sum);
                getGameObjectById('Text_cost').getBehaviour(TextRenderer).text=String(this.cost);
                getGameObjectById('Text_profit').getBehaviour(TextRenderer).text=String(this.profit);
                this.MoneyText="+15";
                this.TipText="+"+String(this.fee_1.toFixed(2));
                break;
            }

            default:{
                break;
            }
    }

        }
}